#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include "List.h"

void test1()
{
	ListNode* list = CreatNode();	
	printf("%d, %p\n", list->val, list->Next);

	PushBack(&list, 1);
	ListPrint(list);
	PushBack(&list, 2);
	ListPrint(list);
	PushBack(&list, 3);
	ListPrint(list);
	PushBack(&list, 4);
	ListPrint(list);

	printf("--------------------------------------------------------------\n");

	PushFront(&list, 9);
	ListPrint(list);

	PushFront(&list, 8);
	ListPrint(list);

	PushFront(&list, 7);
	ListPrint(list);

	PushFront(&list, 6);
	ListPrint(list);

	printf("--------------------------------------------------------------\n");
	PopBack(&list);
	ListPrint(list);
	PopBack(&list);
	ListPrint(list);
	PopBack(&list);
	ListPrint(list);
	PopBack(&list);
	ListPrint(list);

	PushBack(&list, 3);
	ListPrint(list);
	PushBack(&list, 4);
	ListPrint(list);
	printf("--------------------------------------------------------------\n");


	PopFront(&list);
	ListPrint(list);

	PopFront(&list);
	ListPrint(list);

	PopFront(&list);
	ListPrint(list);

	printf("--------------------------------------------------------------\n");


	PushFront(&list, 9);
	ListPrint(list);

	PushFront(&list, 8);
	ListPrint(list);

	ListNode* a = Find(list, 9);
	ListNode* b = Find(list, 10);
	printf("--------------------------------------------------------------\n");
	Insert(&list, 3, 11);
	ListPrint(list);

	Erase(&list, 3);
	ListPrint(list);


	ListDestory(&list);
}


int main()
{

	test1();



	return 0;
}